#include "SList.h"
//创建一个链表，并且打印出来

void CreatSList()
{
	//链表是由一个个的结点构成
	SLTNode* node1 = (SLTNode*)malloc(sizeof(SLTNode));
	node1->data = 1;

	SLTNode* node2 = (SLTNode*)malloc(sizeof(SLTNode));
	node2->data = 2;

	SLTNode* node3 = (SLTNode*)malloc(sizeof(SLTNode));
	node3->data = 3;

	SLTNode* node4 = (SLTNode*)malloc(sizeof(SLTNode));
	node4->data = 4;

	node1->next = node2;
	node2->next = node3;
	node3->next = node4;
	node4->next = NULL;

	SLTNode* pList = node1;

	SLTPushBack(&pList,5);
	SLTPushFront(&pList, 0);
	//SLTPopBack(&pList);
	//SLTPopFront(&pList);
	SLTInsert(&pList,node3,11);
	SLTInsertAfter(&pList, node3, 22);
	//查找
	SLTNode* find = SLTFind(pList, 3);
	SLTErase(&pList, find);
	//打印链表
	SLTPrint(pList);
	SListDestroy(&pList);
}




int main()
{
	CreatSList();

	return 0;
}